package org.example.controller;

import org.example.service.impl.UserService;
import org.example.pojo.UsersTb;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class SayHello {
    @Autowired
    UserService userService;
    @GetMapping("/hello")
    public String sp(){
        return "hello Spring";
    }


    @GetMapping("/user")
    @ResponseBody
    public List<UsersTb> userInfo(){
        List<UsersTb> usersTbs = userService.queryAll();

        return usersTbs;
    }
}
